﻿@{
    ViewBag.Title = "FindAllOfPattern";
    Layout = "~/Views/Shared/_Page.cshtml";
}

<h2>Find All Of Pattern</h2>

<script type="text/javascript">
    window.onload = function () {
        var searchString = "Now is the time and this is the time and that is the time";
        var pattern = /t\w*e/g;
        var matchArray;
        var str = "";

        ZEUS.DEBUG.log("Search Text: " + searchString);

        // check for pattern with regexp exec, if not null, process
        while ((matchArray = pattern.exec(searchString)) != null) {
            ZEUS.DEBUG.log("at " + matchArray.index + " we found " + matchArray[0]);
        }
    }
</script>